package com.ktjy.pojo.system;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.io.Serial;
import java.io.Serializable;

/**
 * 定时任务执行记录表实体类
 *
 * @author LILIBO
 * @since 2025-06-18
 */
@Tag(name = "定时任务执行记录表", description = "定时任务执行记录表数据")
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@TableName("`sys_job_record`")
public class SysJobRecord implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 定时任务执行记录ID
     */
    @Schema(description = "定时任务执行记录ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 定时任务ID
     */
    @Schema(description = "定时任务ID")
    private Long jobId;

    /**
     * 定时任务名称
     */
    @Schema(description = "定时任务名称")
    private String jobName;

    /**
     * 定时任务Cron表达式
     */
    @Schema(description = "定时任务Cron表达式")
    private String jobCron;

    /**
     * 执行结果信息
     */
    @Schema(description = "执行结果信息")
    private String jobMessage;

    /**
     * 开始执行时间
     */
    @Schema(description = "开始执行时间")
    private String startTime;

    /**
     * 结束执行时间
     */
    @Schema(description = "结束执行时间")
    private String endTime;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 状态 0-成功;1-失败
     */
    @Schema(description = "状态 0-成功;1-失败")
    private Integer status;

    /**
     * 记录时间
     */
    @Schema(description = "记录时间")
    private String recordTime;

    /**
     * 带参构造方法
     */
    public SysJobRecord(Long jobId, String jobName, String jobCron, String jobMessage, String startTime, String endTime, String remark, Integer status, String recordTime) {
        this.jobId = jobId;
        this.jobName = jobName;
        this.jobCron = jobCron;
        this.jobMessage = jobMessage;
        this.startTime = startTime;
        this.endTime = endTime;
        this.remark = remark;
        this.status = status;
        this.recordTime = recordTime;
    }

}
